// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Rectangle {
    width: 250
    height: 250
    color: "#00000000"
    id: main
    signal openFullHealth()
    property string lang

    MouseArea {
        id: mouseRegion
        anchors.fill: parent;
        z: 4
        property variant clickedPosition: "1,1"

        onPressed: {
            clickedPosition  = Qt.point(mouse.x,mouse.y)
        }
        onPositionChanged: {
            var mousePosX = (mouse.x <0) ? 0 : mouse.x
           var mousePosY = (mouse.y <0) ? 0 : mouse.y
            var relative = Qt.point(mousePosX-clickedPosition.x, mousePosY-clickedPosition.y)
            main.pos = Qt.point(main.pos.x+relative.x,
                                    main.pos.y+relative.y)

        }
    }

    MouseArea{
        x:0;y:10
        width:parent.width
        height:parent.height
        z:10
        onClicked: {console.log("Health Widget Clicked"); openFullHealth();}
    }
    Rectangle{
        id: steps
        x: 0
        y: 10
        color: "orange"
        height: 70
        width:parent.width
        Text{
            x: 0
            y: -9
            text: if(lang=="1")qsTr("Steps Today"); else qsTr("medidas actuales");
            color:"black"
            font.bold: true
            font.pixelSize: 18
        }
        Text{
            x: 10
            y: 31
            text: if(lang=="1")qsTr("2500 Steps"); else qsTr("2500 medidas");
            z: 1
            color:"white"
            font.bold: true
            font.pixelSize: 14
        }
        Text{
            x: 155
            y: 31
            text: if(lang=="1")qsTr("-500"); else qsTr("-500");
            z: 1
            color:"white"
            font.bold: true
            font.pixelSize: 14
        }
        Rectangle{
            id:backBar
            x: 5
            y: 19
            width:parent.width - 10
            height: 45
            color: "purple"
        }
        Rectangle{
            id:progressBar
            x: 5
            y: 19
            width:150
            height: 45
            color: "green"
        }
    }
    Rectangle{
        id: weight
        x: 0
        y: 97
        color: "orange"
        height: 70
        width:parent.width
        Text{
            x: 0
            y: -10
            text:if(lang=="1")qsTr("Current Weight"); else qsTr("Peso Actual");
            color:"black"
            font.bold: true
            font.pixelSize: 18
        }
        Text{
            x: 46
            y: 36
            width: 50
            height: 12
            text: qsTr("175lbs")
            z: 1
            color:"white"
            font.bold: true
            font.pixelSize: 14
        }
        Text{
            x: 191
            y: 33
            text: qsTr("-5lbs")
            z: 1
            color:"white"
            font.bold: true
            font.pixelSize: 14
        }
        Rectangle{
            id:backBarWeight
            x: 5
            y: 19
            width:parent.width - 10
            height: 45
            color: "purple"
        }
        Rectangle{
            id:progressBarWeight
            x: 5
            y: 19
            width:175
            height: 45
            color: "green"
        }
    }
    Rectangle{
        id: calories
        x: 0
        y: 180
        color: "orange"
        height: 70
        width:parent.width
        Text{
            x: 0
            y: -9
            text: if(lang=="1")qsTr("Calories Burned"); else qsTr("Calorías Quemadas");
            color:"black"
            font.bold: true
            font.pixelSize: 18
        }
        Text{
            x: 10
            y: 33
            width: 50
            height: 12
            text: qsTr("1500 Cals")
            z: 1
            color:"white"
            font.bold: true
            font.pixelSize: 14
        }
        Text{
            x: 132
            y: 33
            text: qsTr("-500 Cals")
            z: 1
            color:"white"
            font.bold: true
            font.pixelSize: 14
        }
        Rectangle{
            id:backBarCals
            x: 5
            y: 19
            width:parent.width - 10
            height: 45
            color: "purple"
        }
        Rectangle{
            id:progressBarCals
            x: 5
            y: 19
            width:80
            height: 45
            color: "green"
        }
    }



}
//Westin
